<template>
    <view class="container">
        <view class="header">
            <navigator url="/pages/myProfile/index">
                <image class="headimg" :src="userInfo.headimg"></image>
            </navigator>
            <view class="middle">
                <view class="name">{{ userInfo.name }}</view>
                <view @tap="__e" class="vip-c" :data-event-opts="[['tap', [['toBuyVip', ['$event']]]]]" v-if="userInfo.vip_status == 1">
                    <text class="new-iconfont icon-vip"></text>
                    <text>{{ $root.g0 + ' 到期' }}</text>
                </view>
                <view @tap="__e" class="vip-c disabled" :data-event-opts="[['tap', [['toBuyVip', ['$event']]]]]" v-else>
                    <text class="new-iconfont icon-vip"></text>
                    <text>开通VIP会员</text>
                </view>
            </view>
            <view class="_div" style="flex-grow: 1"></view>
            <button class="right" openType="contact" v-if="isMiniappAndUseMiniappKf">
                <text class="new-iconfont icon-contact">客服</text>
            </button>
            <button @tap="__e" class="right" :data-event-opts="[['tap', [['openContact', ['$event']]]]]" v-else>
                <text class="new-iconfont icon-contact">客服</text>
            </button>
        </view>
        <view class="status-bar">
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/myRedpack/index']]]]]">
                <view class="number">
                    <label class="small _span">￥</label>
                    {{ (userInfo.redpack || 0) / 100 }}
                </view>
                <view class="text" style="color: #fff">红包余额</view>
            </view>
            <view class="line"></view>
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/myScore/index']]]]]">
                <view class="number">{{ userInfo.score || 0 }}</view>
                <view class="text" style="color: #fff">{{ scoreAlias }}</view>
            </view>
            <view class="line"></view>
            <view class="line"></view>
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/myInvitees/index']]]]]">
                <view class="number">
                    {{ userInfo.invitees_count || 0 }}
                    <label class="small _span">人</label>
                </view>
                <view class="text" style="color: #fff">邀请记录</view>
            </view>
        </view>
        <view class="order-c">
            <view class="top">
                <view class="title">我的订单</view>
                <view @tap="__e" class="all-btn" :data-event-opts="[['tap', [['toDetail', ['/pages/orderList/index?status=all']]]]]">
                    全部订单
                    <text class="icon new-iconfont icon-arrow-right"></text>
                </view>
            </view>
            <view class="body">
                <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/orderList/index?status=pending']]]]]" hoverClass="hover">
                    <image mode="widthFix" src="/static/static/center/order-pending.png" style="width: 66rpx; height: 59rpx"></image>
                    <text>待处理</text>
                </view>
                <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/orderList/index?status=pay_pending']]]]]" hoverClass="hover">
                    <image mode="widthFix" src="/static/center/order-return-sale.png" style="width: 66rpx; height: 59rpx"></image>
                    <text>待付款</text>
                </view>
                <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/orderList/index?status=deliver_pending']]]]]" hoverClass="hover">
                    <image mode="widthFix" src="/static/center/order-deliver-pending.png" style="width: 66rpx; height: 59rpx"></image>
                    <text>待发货</text>
                </view>
                <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/orderList/index?status=delivered']]]]]" hoverClass="hover">
                    <image mode="widthFix" src="/static/center/order-delivered.png" style="width: 66rpx; height: 59rpx"></image>
                    <text>已发货</text>
                </view>
            </view>
        </view>
        <image
            @tap="__e"
            class="share-banner"
            :data-event-opts="[['tap', [['toDetail', ['/pages/shareRule/index']]]]]"
            hoverClass="hover"
            src="https://cdn2.hquesoft.com/box/share-banner.png"
        ></image>
        <view class="action-list action-list-1">
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/myCoupons/index']]]]]" hoverClass="hover">
                <view class="left-icon">
                    <image src="/static/center/coupon.png"></image>
                </view>
                <view class="text">优惠券</view>
                <view class="total">{{ userInfo.coupon_count }}</view>
                <text class="icon new-iconfont icon-arrow-right"></text>
            </view>
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/myCard/index']]]]]" hoverClass="hover">
                <view class="left-icon">
                    <image src="/static/center/toushi.png" style="width: 30rpx; height: 30rpx"></image>
                </view>
                <view class="text">道具卡</view>
                <view class="total">0</view>
                <text class="icon new-iconfont icon-arrow-right"></text>
            </view>
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/myActivity/index']]]]]" hoverClass="hover">
                <view class="left-icon">
                    <image src="/static/static/center/activity.png" style="width: 26rpx; height: 30rpx"></image>
                </view>
                <view class="text">我的活动</view>
                <view class="total">{{ userInfo.working_activity }}</view>
                <text class="icon new-iconfont icon-arrow-right"></text>
            </view>
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/code/index']]]]]" hoverClass="hover">
                <view class="left-icon">
                    <image src="/static/center/rule.png" style="width: 30rpx; height: 30rpx"></image>
                </view>
                <view class="text">兑换码</view>
                <text class="icon new-iconfont icon-arrow-right"></text>
            </view>
            <view @tap="__e" class="item" :data-event-opts="[['tap', [['toDetail', ['/pages/scoreRedPack/index']]]]]" hoverClass="hover">
                <view class="left-icon">
                    <image src="/static/center/score.png" style="width: 30rpx; height: 30rpx"></image>
                </view>
                <view class="text">赏包</view>
                <text class="icon new-iconfont icon-arrow-right"></text>
            </view>
        </view>
        <view class="action-list">
            <view
                @tap="__e"
                class="item"
                :data-event-opts="[['tap', [['toLink', ['$0'], [[['items', '', index, 'link']]]]]]]"
                hoverClass="hover"
                v-for="(item, index) in items"
                :key="index"
            >
                <view class="left-icon">
                    <image :src="item.image"></image>
                </view>

                <view class="text">{{ item.text }}</view>

                <text class="icon new-iconfont icon-arrow-right"></text>
            </view>
        </view>
        <image
            @tap="__e"
            :class="['float-btn', isAnimated ? 'float-icon-animate' : '']"
            :data-event-opts="[['tap', [['toDayTask', ['$event']]]]]"
            hoverClass="hover"
            src="https://cdn2.hquesoft.com/box/center-float-btn.png"
        ></image>
    </view>
</template>

<script>
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['pages/center/detail'],
    {
        '0c4d': function (t, e, n) {
            'use strict';

            (function (t, e) {
                var r = n('4ea4');
                n('18ba');
                r(n('66fd'));
                var i = r(n('5c27'));
                t.__webpack_require_UNI_MP_PLUGIN__ = n;
                e(i.default);
            }.call(this, n('bc2e').default, n('543d').createPage));
        },
        '0ecb': function (t, e, n) {
            'use strict';

            n.d(e, 'b', function () {
                return r;
            });
            n.d(e, 'c', function () {
                return i;
            });
            n.d(e, 'a', function () {});
            var r = function () {
                this.$createElement;
                var t = (this._self._c, 1 == this.userInfo.vip_status ? this.$tool.formatDate(this.userInfo.vip_end_at, 'yyyy-MM-dd') : null);
                this.setData(
                    Object.assign(
                        {},
                        {
                            $root: {
                                g0: t
                            }
                        }
                    )
                );
            };
            var i = [];
        },
        '159b': function (t, e, n) {
            'use strict';

            n.r(e);
            var r = n('9a5f');
            var i = n.n(r);
            for (var o in r) {
                if (['default'].indexOf(o) < 0) {
                    (function (t) {
                        n.d(e, t, function () {
                            return r[t];
                        });
                    })(o);
                }
            }
            e.default = i.a;
        },
        '5c27': function (t, e, n) {
            'use strict';

            n.r(e);
            var r = n('0ecb');
            var i = n('159b');
            for (var o in i) {
                if (['default'].indexOf(o) < 0) {
                    (function (t) {
                        n.d(e, t, function () {
                            return i[t];
                        });
                    })(o);
                }
            }
            n('d157');
            var c = n('f0c5');
            var a = Object(c.a)(i.default, r.b, r.c, false, null, null, null, false, r.a, void 0);
            e.default = a.exports;
        },
        '88f7': function (t, e, n) {},
        '9a5f': function (t, e, n) {
            'use strict';

            (function (t) {
                var r = n('4ea4');
                Object.defineProperty(e, '__esModule', {
                    value: true
                });
                e.default = void 0;
                var i = r(n('9523'));
                function o(t, e) {
                    var n = Object.keys(t);
                    if (Object.getOwnPropertySymbols) {
                        var r = Object.getOwnPropertySymbols(t);
                        if (e) {
                            r = r.filter(function (e) {
                                return Object.getOwnPropertyDescriptor(t, e).enumerable;
                            });
                        }
                        n.push.apply(n, r);
                    }
                    return n;
                }
                function c(t) {
                    for (var e = 1; e < arguments.length; e++) {
                        if (null != arguments[e]) {
                            var n = arguments[e];
                        } else {
                            var n = {};
                        }
                        e % 2
                            ? o(Object(n), true).forEach(function (e) {
                                  (0, i.default)(t, e, n[e]);
                              })
                            : Object.getOwnPropertyDescriptors
                            ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n))
                            : o(Object(n)).forEach(function (e) {
                                  Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e));
                              });
                    }
                    return t;
                }
                var a = {
                    name: 'center',
                    components: {},
                    data: function () {
                        return {
                            code: '',
                            init: false,
                            isAnimated: true
                        };
                    },
                    computed: c(
                        c({}, (0, n('26cb').mapGetters)(['deviceInfo', 'userInfo', 'token', 'personalSettings'])),
                        {},
                        {
                            isLogin: function () {
                                return !!this.token;
                            },
                            userName: function () {
                                return this.token ? this.userInfo.name : '点击登录';
                            },
                            avatar: function () {
                                return this.token ? this.userInfo.headimg : '/static/toux.png';
                            },
                            config: function () {
                                return this.$store.getters.setting.user_center;
                            },
                            items: function () {
                                return (this.config && this.config.items) || [];
                            }
                        }
                    ),
                    onLoad: function () {
                        var that = this;
                        t.login({
                            success: function (t) {
                                that.code = t.code;
                            },
                            fail: function (t) {}
                        });
                        this.$visitor.record('center');
                    },
                    onShow: function () {
                        this.$store.dispatch('getUserInfo');
                    },
                    methods: {
                        toDetail: function (e) {
                            t.navigateTo({
                                url: e
                            });
                        },
                        toDayTask: function () {
                            this.isAnimated = false;
                            t.navigateTo({
                                url: '/pages/dayTask/index'
                            });
                        },
                        toBuyVip: function () {
                            t.navigateTo({
                                url: '/pages/buyVip/index'
                            });
                        }
                    }
                };
                e.default = a;
            }.call(this, n('543d').default));
        },
        d157: function (t, e, n) {
            'use strict';

            var r = n('88f7');
            n.n(r).a;
        }
    },
    [['0c4d', 'common/runtime', 'common/vendor']]
]);
</script>
<style>
@import './detail.css';
</style>
